<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html class=" -webkit-">
	<head>
		
	<meta charset="utf-8">
    <title>杰利联合</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
	<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <meta content="application/xhtml+xml;charset=UTF-8" http-equiv="Content-Type">
    <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
    <meta content="no-cache" http-equiv="pragma">
    <meta content="0" http-equiv="expires">
    <meta content="telephone=no, address=no" name="format-detection">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/jiu/css/mobile_module.css?v=1492659303" media="all">
   
    <script type="text/javascript" src="${ctxStatic}/jiu/js/jquery-2.0.3.min.js"></script>
	
    <link href="${ctxStatic}/jiu/css/common.css?v=1492659303" rel="stylesheet" type="text/css">
		<style>
			.hearder{
				height: 50px;
				background-color: #30B0F3;
				width: 100%;
				text-align: center;
				color: white;
				font-size: 20px;
                line-height:50px;
                position: fixed;
			    top: 0;
			    z-index: 1;
			}
			.tixian{
				position: relative;
			    padding: 5px 10px;
			    background-color: #FFFFFF;
			    border-bottom: 1px #eee solid;
			}
			.tixian h1 {
			    font-style: normal;			  
			    font-size: 16px;
			    font-weight: normal;
			    margin-bottom: 2px;
			    overflow: hidden;
			    width: 100%;
			    text-overflow: ellipsis;
				white-space: nowrap;
			}
			.tixian h2 {
			    font-style: normal;
			    color: #F14F41;
			    font-size: 16px;
			    font-weight: normal;
			    text-align: right;
			    			}
			.tixian p{
				font-size: 14px;
    			color: #999999;
    		
			}
			
			.tixian span{			
			    font-size: 14px;
		        color: #999999;
			}
		</style>
</head>
<body>
	<header  class="hearder">
			<a href="javascript:window.history.go(-1);">
				<img src="${ctxStatic}/jiu/img/fanhui.png" style="height: 20px;color: white;top:15px;position: absolute;left: 10px;"/>
				</a>
				${type eq '520'?'结算明细':'收支明细'}
	</header>		
	<ul style="margin-top: 50px;">
	
		<%-- <c:forEach items="${jiuBalancePaymentsLogList}" var="balancePaymentsLog">
			<!-- 1：充值记录 2：撤单记录 3：结算记录 4：下单记录 5：提现记录 6：反审记录 -->
			<c:choose>
			    <c:when test="${balancePaymentsLog.type eq 1}">
			      		<li>
							<div class="tixian">
								<div style="float: left;">
									<h1>充值${balancePaymentsLog.money}元</h1>
									<span><fmt:formatDate value="${balancePaymentsLog.createTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss" /></span>	
								</div>
								<div style="float: right;">					
									<h2>+${balancePaymentsLog.point}分</h2>
								   <p>当前积分:${balancePaymentsLog.nowPoint}</p>
								</div>
								<div style="clear: both;"></div>
							</div>
						</li>
			    </c:when>
			    <c:when test="${balancePaymentsLog.type eq 2}">
			      		<li>
							<div class="tixian">
								<div style="float: left;">
									<h1>厂家撤单</h1>
									<span><fmt:formatDate value="${balancePaymentsLog.createTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss" /></span>	
								</div>
								<div style="float: right;">					
									<h2>+${balancePaymentsLog.point}分</h2>
								   <p>当前积分:${balancePaymentsLog.nowPoint}</p>
								</div>
								<div style="clear: both;"></div>
							</div>
						</li>
			    </c:when>
			    <c:when test="${balancePaymentsLog.type eq 3}">
			      		<li>
							<div class="tixian">
								<div style="float: left;">
									<h1>结算到账</h1>
									<span><fmt:formatDate value="${balancePaymentsLog.createTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss" /></span>	
								</div>
								<div style="float: right;">					
									<h2>+${balancePaymentsLog.point}分</h2>
								   <p>当前积分:${balancePaymentsLog.nowPoint}</p>
								</div>
								<div style="clear: both;"></div>
							</div>
						</li>
			    </c:when>
			    <c:when test="${balancePaymentsLog.type eq 4}">
			      			<li>
							<div class="tixian">
								<div style="float: left;">
									<h1>下单消费</h1>
									<span><fmt:formatDate value="${balancePaymentsLog.createTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss" /></span>	
								</div>
								<div style="float: right;">					
									<h2>-${balancePaymentsLog.point}分</h2>
								   <p>当前积分:${balancePaymentsLog.nowPoint}</p>
								</div>
								<div style="clear: both;"></div>
							</div>
						</li>
			    </c:when>
			    <c:when test="${balancePaymentsLog.type eq 5}">
			      			<li>
								<div class="tixian">
									<div style="float: left;">
										<h1>提现${balancePaymentsLog.money}元</h1>
										<span><fmt:formatDate value="${balancePaymentsLog.createTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss" /></span>	
									</div>
									<div style="float: right;">					
										<h2>-${balancePaymentsLog.point}分</h2>
									   <p>当前积分:${balancePaymentsLog.nowPoint}</p>
									</div>
									<div style="clear: both;"></div>
								</div>
							</li>
			    </c:when>
			    <c:when test="${balancePaymentsLog.type eq 6}">
			      			<li>
								<div class="tixian">
									<div style="float: left;">
										<h1>反审扣除积分</h1>
										<span><fmt:formatDate value="${balancePaymentsLog.createTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss" /></span>	
									</div>
									<div style="float: right;">					
										<h2>-${balancePaymentsLog.point}分</h2>
									   <p>当前积分:${balancePaymentsLog.nowPoint}</p>
									</div>
									<div style="clear: both;"></div>
								</div>
							</li>
			    </c:when>
			    <c:otherwise>
			    </c:otherwise>
			</c:choose>
		</c:forEach> --%>
		
	</ul>
	
	
	<script type="text/javascript">
 
//获取滚动条当前的位置 

function getScrollTop() { 

var scrollTop = 0; 

if (document.documentElement && document.documentElement.scrollTop) { 

scrollTop = document.documentElement.scrollTop; 

} 

else if (document.body) { 

scrollTop = document.body.scrollTop; 

} 

return scrollTop; 

} 



//获取当前可是范围的高度 

function getClientHeight() { 

var clientHeight = 0; 

if (document.body.clientHeight && document.documentElement.clientHeight) { 

clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight); 

} 

else { 

clientHeight = Math.max(document.body.clientHeight, document.documentElement.clientHeight); 

} 

return clientHeight; 

} 



//获取文档完整的高度 

function getScrollHeight() { 

return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 

} 



window.onscroll = function () {

	$("#tip").html("请等待正在加载中……");

if (getScrollTop() + getClientHeight() == getScrollHeight()) { 
	if(pageNo!='1'){
		pullupRefresh();
	}

	$("#tip").html("上拉加载更多");

}

} 

$(function(){
	pullupRefresh();
	
});


var pageNo = 1;


/**

 * 上拉加载具体业务实现

 */

 var ajaxFlag = 1;

function pullupRefresh() {
	
	/* $("#tip").html("正在加载中");

	if(ajaxFlag==0){

		return ;

	} */


	 $.get("${ctxFront}/jiu/ajaxBalancePayments?v="+Math.random(), {uid:"${uid}",pageNo: pageNo,pageSize:15,type:"${type}"}, function(data){

		var list = data.result;
		 
			//alert(list.length);
			
		var innerHTML= "";
	
		 if(pageNo==1 && list.length==0){
			 innerHTML+='<div class="empty_container">'+
						'<p>暂时无记录</p>'+
						'</div>';
			}

		 
		 pageNo++;

		$.each(list, function(i, n){
			 innerHTML+='<li>'+
							'<div class="tixian">';
			 if(n.type=='1'){
					innerHTML+='<h1>充值'+n.money+'元   单号：'+n.orderNo+'</h1>';
				}else if(n.type=='2'){
					innerHTML+='<h1>厂家撤单  单号：'+n.orderNo+'</h1>';
				}else if(n.type=='3'){
					innerHTML+='<h1>结算到账  单号：'+n.orderNo+'</h1>';
				}else if(n.type=='4'){
					innerHTML+='<h1>下单消费  单号：'+n.orderNo+'</h1>';
				}else if(n.type=='5'){
					innerHTML+='<h1>提现'+n.money+'元    单号'+n.orderNo+'</h1>';
				}else if(n.type=='6'){
					innerHTML+='<h1>反审扣除积分  单号：'+n.orderNo+'</h1>';
					if(typeof(n.applyName) !="undefined"){ 
						innerHTML+='<p style="text-algin:left;margin-top:10px;margin-bottom:10px">申请人：'+n.applyName+'</p><p style="margin-bottom:5px">申请时间:'+getLocalTime(n.applyTime)+'</p>';
					}
					if(typeof(n.applyRemarks) !="undefined"){ 
						innerHTML+='<p style="text-algin:left;margin-top:10px;margin-bottom:10px">申请原因：'+n.applyRemarks+'</p>';
					}
				}else if(n.type=='7'){
					innerHTML+='<h1>提现撤销  单号：'+n.orderNo+'</h1>';
				}else if(n.type=='8'){
					innerHTML+='<h1>充值订单修改  单号：'+n.orderNo+'</h1>';
				}else if(n.type=='9'){
					innerHTML+='<h1>充值订单修改  单号：'+n.orderNo+'</h1>';
				}
							innerHTML+='<div style="float: left;">';
								
								
								if(n.type=='2' || n.type=='4'){
									/* innerHTML+='<span>'+getLocalTime(n.createTime)+
										'</span>&nbsp;<span style="font-size: 7px;">厂家：'+n.name+'</span>'+
									'</div>'+
									'<div style="float: right;">'; */
									innerHTML+='<p style="font-size: 14px;text-algin:left">厂家：'+n.name+'</p>&nbsp;<span>'+getLocalTime(n.createTime)+
									'</span>'+
								'</div>'+
								'<div style="float: right;">';
								}else if(n.type=='3'){
									/* innerHTML+='<span>'+getLocalTime(n.createTime)+
										'</span>&nbsp;<span style="font-size: 7px;">门店：'+n.storeName+'</span>'+
									'</div>'+
									'<div style="float: right;">'; */
									innerHTML+='<p style="font-size: 14px;text-algin:left">买家：'+n.storeName+'</p>&nbsp;<span>'+getLocalTime(n.createTime)+
									'</span>'+
								'</div>'+
								'<div style="float: right;">';
								}else{
									innerHTML+='<p style="font-size: 14px;text-algin:left">&nbsp;</p><span>'+getLocalTime(n.createTime)+
										'</span>'+
									'</div>'+
									'<div style="float: right;">';
								}
								
								if(n.type=='2' || n.type=='4'){
									
								}
								
								if(n.type=='1'){
									innerHTML+='<h2>+'+n.point+'分</h2>';
								}else if(n.type=='2'){
									innerHTML+='<h2>+'+n.point+'分</h2>';
								}else if(n.type=='3'){
									innerHTML+='<h2>+'+n.point+'分</h2>';
								}else if(n.type=='4'){
									innerHTML+='<h2>-'+n.point+'分</h2>';
								}else if(n.type=='5'){
									innerHTML+='<h2>-'+n.point+'分</h2>';
								}else if(n.type=='6'){
									innerHTML+='<h2>-'+n.point+'分</h2>';
								}else if(n.type=='7'){
									innerHTML+='<h2>+'+n.point+'分</h2>';
								}else if(n.type=='8'){
									innerHTML+='<h2>-'+n.point+'分</h2>';
								}else if(n.type=='9'){
									innerHTML+='<h2>+'+n.point+'分</h2>';
								}
								
									
								innerHTML+='<p>当前积分:'+n.nowPoint+'</p>'+
								'</div>'+
								'<div style="clear: both;">'+
								'</div>'+
							'</div>'+
						'</li>';
			 });
		 $("ul").append(innerHTML);
	  }); 

}


$(function(){
	Date.prototype.Format = function (fmt) { //author: meizz 
	    var o = {
	        "M+": this.getMonth() + 1, //月份 
	        "d+": this.getDate(), //日 
	        "h+": this.getHours(), //小时 
	        "m+": this.getMinutes(), //分 
	        "s+": this.getSeconds(), //秒 
	        "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
	        "S": this.getMilliseconds() //毫秒 
	    };
	    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
	    for (var k in o)
	    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
	    return fmt;
	}
	
});

function getLocalTime(nS) {  
    var date = new Date(nS);
    return date.Format("yyyy-MM-dd hh:mm:ss"); 
} 
</script>
	
</body>
</html>